/**
 * Created by Fly on 2016/9/23.
 */
var express = require('express');
var router = express.Router();
var orderDao=require('../dao/orderDao');
var filter=require('../util/filter');
router.get('/',function(req,res){
    if(req.session.userID==undefined){
        res.redirect('/login');
    }else {
        orderDao.getinfo(req,res,function(data){
            console.log(data);
            res.render('orderinfo',{order:data,username:req.session.userID});
        })
    }
});
    router.post('/del', function(req,res) {
        orderDao.del(req,function(result){
            if(result.affectedRows==1){
                res.json({res:"1"});
            }else{
                res.json({res:"0"});
            }
        });
    });

module.exports = router;